import xlwt
import pdfplumber

workbook = xlwt.Workbook()
sheet = workbook.add_sheet("普通表格读取")


pdf_path = "./Toys/PDFToys/普通表格.pdf"
pdf = pdfplumber.open(pdf_path)

i = 0
for page in pdf.pages:
    for table in page.extract_tables():
        for row in table:
            print(row)
            for j in range(len(row)):
                sheet.write(i, j, row[j])
            i = i + 1
pdf.close()
workbook.save("./Toys/PDFToys/普通表格.xls")
print('\n')
print('写入成功!')
